home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
ctutor.exe
/
SOURCE
/
CHAROUT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-15
|
823b
|
38 lines
/* Chapter 10 - Program 2 - CHAROUT.C */
#include "stdio.h"
#include "string.h"
void main()
{
FILE *point;
char others[35];
int indexer, count;
strcpy(others, "Additional lines.");
point = fopen("tenlines.txt", "a"); /* open for appending */
for (count = 1 ; count <= 10 ; count++) {
for (indexer = 0 ; others[indexer] ; indexer++)
putc(others[indexer], point); /* output one character */
putc('\n', point); /* output a linefeed */
}
fclose(point);
}
/* Result of output (appended to TENLINES.TXT)
Additional lines.
Additional lines.
Additional lines.
Additional lines.
Additional lines.
Additional lines.
Additional lines.
Additional lines.
Additional lines.
Additional lines.
*/